clear all
set more off, perm
set maxvar 120000
set varabbrev off
* ---------------------------------------------- *
global dir 	"`1'"
global dir 	"/mnt/brownresearch/ECON_LaPorta/rlaporta/research/BGLS2024/ReplicationCode"
global Data 	$dir/Data
global Tables 	$dir/Tables
global Figures 	$dir/Figures
global Work 	$dir/Work
global Temp 	$dir/Temp
* ---------------------------------------------- *
use if portf==6 using $Work/portfolio_BOOK_qnic, clear

label var datem "Date"
twoway (tsline cumNRetYr1, lcolor(black)) (tsline cumQRetYr1, lcolor(red)) , /*
*/ legend(order(1 "One-year HML Ret" 2 "One-year HML EBR") size(small) rows(1) region(lstyle(none))) scheme(s1mono) 
graph export $Figures/graphs_figure01_BOOK.tif, replace
keep datem cumNRetYr1 cumQRetYr1
rename datem date
export delimited using "$Figures/graphs_figure01_BOOK.csv", replace
export delimited using "$Figures/graphs_figure01_BOOK.csv", replace
* ******************************************************************************
use if portf==6 using $Work/portfolio_INV_qnic, clear

label var datem "Date"
twoway (tsline cumNRetYr1, lcolor(black)) (tsline cumQRetYr1, lcolor(red)) , /*
*/ legend(order(1 "One-year CMA Ret" 2 "One-year CMA EBR") size(small) rows(1) region(lstyle(none))) scheme(s1mono) 
graph export $Figures/graphs_figure01_INV.tif, replace 
keep datem cumNRetYr1 cumQRetYr1
rename datem date
export delimited using "$Figures/graphs_figure01_INV.csv", replace
export delimited using "$Figures/graphs_figure01_INV.csv", replace
* ******************************************************************************
use if portf==6 using $Work/portfolio_PROF_qnic, clear

label var datem "Date"
twoway (tsline cumNRetYr1, lcolor(black)) (tsline cumQRetYr1, lcolor(red)) , /*
*/ legend(order(1 "One-year RMW Ret" 2 "One-year RMW EBR") size(small) rows(1) region(lstyle(none))) scheme(s1mono) 
graph export $Figures/graphs_figure01_PROF.tif, replace 
keep datem cumNRetYr1 cumQRetYr1
rename datem date
export delimited using "$Figures/graphs_figure01_PROF.csv", replace
export delimited using "$Figures/graphs_figure01_PROF.csv", replace
* ******************************************************************************
use if portf==6 using $Work/portfolio_SIZE_qnic, clear

label var datem "Date"
twoway (tsline cumNRetYr1, lcolor(black)) (tsline cumQRetYr1, lcolor(red)) , /*
*/ legend(order(1 "One-year SMB Ret" 2 "One-year SMB EBR") size(small) rows(1) region(lstyle(none))) scheme(s1mono) 
graph export $Figures/graphs_figure01_SIZE.tif, replace
keep datem cumNRetYr1 cumQRetYr1
rename datem date
export delimited using "$Figures/graphs_figure01_SIZE.csv", replace
export delimited using "$Figures/graphs_figure01_SIZE.csv", replace 
* ******************************************************************************
use if portf==6 using $Work/portfolio_MOME_qnic, clear

label var datem "Date"
twoway (tsline cumNRetYr1, lcolor(black)) (tsline cumQRetYr1, lcolor(red)) , /*
*/ legend(order(1 "One-year WML Ret" 2 "One-year WML EBR") size(small) rows(1) region(lstyle(none))) scheme(s1mono) 
graph export $Figures/graphs_figure01_MOME.tif, replace 
keep datem cumNRetYr1 cumQRetYr1
rename datem date
export delimited using "$Figures/graphs_figure01_MOME.csv", replace
export delimited using "$Figures/graphs_figure01_MOME.csv", replace
* ******************************************************************************
